home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 2 / 002.d81 / hiding memory b < prev    next >
Encoding:
Text File  |  1984-01-01  |  2.7 KB  |  171 lines

  1.            P.B.A.R. (part B)
  2.            -------- --------
  3.  
  4.  
  5.  
  6.   Now for the real trick......
  7.  
  8.    I. LOAD a program into the normal
  9.  
  10.       area (2049).
  11.  
  12.   II. Change the pointers using:
  13.  
  14.       >poke 43,x1:poke44,x2
  15.  
  16.  III. LOAD another program.  This
  17.  
  18.       program will be loaded starting
  19.  
  20.       at the address: x1+x2*256.
  21.  
  22.   IV. Alternate between the two pro-
  23.  
  24.       grams by POKEing 43 & 44 to
  25.  
  26.       either (1 & 8) for the original
  27.  
  28.       program or to (x1 & x2) for
  29.  
  30.       the hidden program.
  31.  
  32.    V. Example:
  33.  
  34.       >LOAD "program 1",8
  35.  
  36.       >POKE 43,1:POKE 44,25
  37.  
  38.       >LOAD "program 2",8
  39.  
  40.           then
  41.  
  42.  for program 1: >POKE 43,1:POKE44,8
  43.  for program 2: >POKE 43,1:POKE44,25
  44.  
  45.  
  46. Now you should be able to BURY AND
  47.  
  48. RETRIEVE any programs.
  49.  
  50.  
  51.  
  52. **And now for THREE words of warning**
  53.  
  54.  
  55.   In normal operation if you:
  56.  
  57.      >print peek(2048)
  58.  
  59.   you should get:
  60.  
  61.      > 0
  62.  
  63.   When doing BURIAL AND RETRIEVAL, be
  64.  
  65. POSITIVELY, ABSOLUTELY SURE that the
  66.  
  67. location right before where you are
  68.  
  69. going to start a load is set to ZERO.
  70.  
  71. Do this by:
  72.  
  73.        >poke(x1+x2*256)-1,0
  74.  
  75. The Commodore Operating System
  76.  
  77. requires that the address right before
  78.  
  79. a program to be set to zero.
  80.  
  81.  
  82.    ****Warning #2****
  83.  
  84.   When you calculate your loading
  85.  
  86. address for your second program, be
  87.  
  88. sure that the value is between 2048
  89.  
  90. and 40959.  This is to insure that
  91.  
  92. your program will go into a space
  93.  
  94. which is used for BASIC programs.  You
  95.  
  96. also don't want to stick your program
  97.  
  98. somewhere that will blow up your whole
  99.  
  100. system and/or lock you out.  So be
  101.  
  102. careful when doing P.B.A.R.
  103.  
  104.   ****warning #3****
  105.  
  106. You wind up with less variable space
  107.  
  108. available when you use P.B.A.R.
  109.  
  110.  
  111. have fun and good luck!!!!
  112.  
  113.                    - Alan
  114.            .........
  115.  
  116. Alan didn't mention this, but you
  117.  
  118. don't have to "RUN" a second program
  119.  
  120. to make this technique work.  When you
  121.  
  122. link back to the original program you
  123.  
  124. loaded the variables from the second
  125.  
  126. one are still intact.  So, if you
  127.  
  128. "GOTO" a line in the "buried" program
  129.  
  130. instead of running it, you can use the
  131.  
  132. buried program (or programs, if you're
  133.  
  134. ambitious) as subroutines of the
  135.  
  136. topmost.
  137.  
  138.  
  139.   ALSO!!!!  If you want to look at a
  140.  
  141. directory without blowing your program
  142.  
  143. away, POKE 44,128 (or some other
  144.  
  145. suitably high address).  Then load
  146.  
  147. the directory (LOAD"$",8).  When you
  148.  
  149. are done looking at the directory,
  150.  
  151. POKE 44,8.  You can then resume your
  152.  
  153. regularly scheduled programming.
  154.  
  155.   (Later, if you want to look at the
  156.  
  157. directory again, chances are good that
  158.  
  159. some of it will still be in memory
  160.  
  161. waiting for a POKE 44,128 to reveal
  162.  
  163. it again.   Remember, all you have to
  164.  
  165. do is LIST it and then set the
  166.  
  167. pointers back to normal (1 & 8).
  168.  
  169.                      - Jimmy Weiler
  170. --------------------------------------
  171.